{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Helpers"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "source": [
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "\n",
    "def plot_function(f,tmin,tmax,tlabel=None,xlabel=None,axes=False, **kwargs):\n",
    "    ts = np.linspace(tmin,tmax,1000)\n",
    "    if tlabel:\n",
    "        plt.xlabel(tlabel,fontsize=18)\n",
    "    if xlabel:\n",
    "        plt.ylabel(xlabel,fontsize=18)\n",
    "    plt.plot(ts, [f(t) for t in ts], **kwargs)\n",
    "    if axes:\n",
    "        total_t = tmax-tmin\n",
    "        plt.plot([tmin-total_t/10,tmax+total_t/10],[0,0],c='k',linewidth=1)\n",
    "        plt.xlim(tmin-total_t/10,tmax+total_t/10)\n",
    "        xmin, xmax = plt.ylim()\n",
    "        plt.plot([0,0],[xmin,xmax],c='k',linewidth=1)\n",
    "        plt.ylim(xmin,xmax)"
   ],
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Here are helper functions to plot volume or flow rate vs. time with correct labels."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "source": [
    "def plot_volume(f,tmin,tmax,axes=False,**kwargs):\n",
    "    plot_function(f,tmin,tmax,tlabel=\"time (hr)\", xlabel=\"volume (bbl)\", axes=axes, **kwargs)\n",
    "\n",
    "def plot_flow_rate(f,tmin,tmax,axes=False,**kwargs):\n",
    "    plot_function(f,tmin,tmax,tlabel=\"time (hr)\", xlabel=\"flow rate (bbl/hr)\", axes=axes, **kwargs)"
   ],
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 1 Calculating average flow rates from volumes"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "These are the *actual* volume and flow rate functions, used throughout the chapter.  You can ignore the formulas that define them."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "source": [
    "def volume(t):\n",
    "    return (t-4)**3 / 64 + 3.3\n",
    "\n",
    "def flow_rate(t):\n",
    "    return 3*(t-4)**2 / 64"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "source": [
    "plot_volume(volume,0,10)"
   ],
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1.1 Implementing an average_flow_rate function\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "source": [
    "def average_flow_rate(v,t1,t2):\n",
    "    return (v(t2) - v(t1))/(t2 - t1)"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "source": [
    "volume(4)"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "source": [
    "volume(9)"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "source": [
    "average_flow_rate(volume,4,9)"
   ],
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1.2 Picturing the average flow rate with a secant line"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1.3 Negative rates of change"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "source": [
    "def decreasing_volume(t):\n",
    "    if t < 5:\n",
    "        return 10 - (t**2)/5\n",
    "    else:\n",
    "        return 0.2*(10-t)**2"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "source": [
    "plot_volume(decreasing_volume,0,10)"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "source": [
    "average_flow_rate(decreasing_volume,0,4)"
   ],
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1.4 Exercises"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Exercise:** Suppose you start a road-trip at noon, when your odometer reads 77,641 miles and you end your road-trip at 4:30 in the afternoon with your odometer reading 77,905 miles.  What was your average speed during the trip?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "source": [
    "(77905 - 77641) / 4.5"
   ],
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Exercise:** Write a Python function `secant_line(f,x1,x2)` that takes a function `f(x)` and two `x` values `x1` and `x2` and returns a new function representing a secant line over time.  For instance, if you ran `line = secant_line(f,x1,x2)` then `line(3)` would give you the $y$-value of the secant line at $x=3$."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "source": [
    "def secant_line(f,x1,x2):\n",
    "    def line(x):\n",
    "        return f(x1) + (x-x1) * (f(x2)-f(x1))/(x2-x1)\n",
    "    return line"
   ],
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Exercise:** Write a function that uses the code from the previous exercise to plot a secant line of a function f between two given points."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "source": [
    "def plot_secant(f,x1,x2,color='k'):\n",
    "    line = secant_line(f,x1,x2)\n",
    "    plot_function(line,x1,x2,c=color)\n",
    "    plt.scatter([x1,x2],[f(x1),f(x2)],c=color)"
   ],
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Example: secant line from t=4 to t=8 on our volume graph"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "source": [
    "plot_volume(volume,0,10)\n",
    "plot_secant(volume,4,8)"
   ],
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 2 Plotting the average flow rate over time"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2.1 Finding the average flow rate in different time intervals"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "source": [
    "import numpy as np\n",
    "np.arange(0,10,0.5)"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "source": [
    "def interval_flow_rates(v,t1,t2,dt):\n",
    "    return [(t,average_flow_rate(v,t,t+dt))\n",
    "                for t in np.arange(t1,t2,dt)]"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "source": [
    "interval_flow_rates(volume,0,10,1)"
   ],
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2.2 Plotting the interval flow rates alongside the flow rate function"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "source": [
    "def plot_interval_flow_rates(volume,t1,t2,dt):\n",
    "    series = interval_flow_rates(volume,t1,t2,dt)\n",
    "    times = [t for (t,_) in series]\n",
    "    rates = [q for (_,q) in series]\n",
    "    plt.scatter(times,rates)"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "source": [
    "plot_interval_flow_rates(volume,0,10,1)"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "source": [
    "plot_flow_rate(flow_rate,0,10)\n",
    "plot_interval_flow_rates(volume,0,10,1)"
   ],
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Average flow rate on 20 minute (1/3 hour) intervals, compared to actual `flow_rate` function"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "source": [
    "plot_flow_rate(flow_rate,0,10)\n",
    "plot_interval_flow_rates(volume,0,10,1/3)"
   ],
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2.3 Exercises"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Exercise:** Plot the `decreasing_volume` flow rates over time on 0.5 hour intervals.  When is it’s flow rate the lowest?  That is, when is oil leaving the tank at the fastest rate?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "source": [
    "plot_interval_flow_rates(decreasing_volume,0,10,0.5)"
   ],
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Exercise:** Write a linear volume function and plot the flow rate over time to show that it is constant."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "source": [
    "def linear_volume_function(t):\n",
    "    return 5*t + 3\n",
    "\n",
    "plot_interval_flow_rates(linear_volume_function,0,10,0.25)"
   ],
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 3 Approximating instantaneous flow rates"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 3.1 Finding the slope of very small secant lines"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "These calculations result in numbers converging (getting closer and closer) to a value of `0.421875`"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "source": [
    "average_flow_rate(volume,0.5,1.5)"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "source": [
    "average_flow_rate(volume,0.9,1.1)"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "source": [
    "average_flow_rate(volume,0.99,1.01)"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "source": [
    "average_flow_rate(volume,0.999,1.001)"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "source": [
    "average_flow_rate(volume,0.9999,1.0001)"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "source": [
    "average_flow_rate(volume,0.99999,1.00001)"
   ],
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Compare to actual value from flow rate function"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "source": [
    "flow_rate(1)"
   ],
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 3.2 Building the instantaneous flow rate function"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "source": [
    "def instantaneous_flow_rate(v,t,digits=6):\n",
    "    tolerance = 10 ** (-digits) #<1>\n",
    "    h = 1\n",
    "    approx = average_flow_rate(v,t-h,t+h) #<2>\n",
    "    for i in range(0,2*digits): #<3>\n",
    "        h = h / 10\n",
    "        next_approx = average_flow_rate(v,t-h,t+h) #<4>\n",
    "        if abs(next_approx - approx) < tolerance:\n",
    "            return round(next_approx,digits) #<5>\n",
    "        else:\n",
    "            approx = next_approx #<6>\n",
    "    raise Exception(\"Derivative did not converge\") #<7>"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "source": [
    "instantaneous_flow_rate(volume,1)"
   ],
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 3.3 Currying and plotting the instantaneous flow rate function"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "source": [
    "def get_flow_rate_function(v):\n",
    "    def flow_rate_function(t):\n",
    "        instantaneous_flow_rate(volume,t)\n",
    "    return flow_rate_function"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "source": [
    "plot_function(flow_rate,0,10)\n",
    "plot_function(get_flow_rate_function(volume),0,10)"
   ],
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 3.4 Exercises"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Exercise:** Confirm that the graph of the `volume` function is not a straight line on the interval from 0.999 hours to 1.001 hours."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {},
   "source": [
    "volume(1)"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "metadata": {},
   "source": [
    "secant_line(volume,0.999,1.001)(1)"
   ],
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Exercise:** Approximate the slope of a tangent line to the `volume` graph at $t=8$ by computing the slopes of smaller and smaller secant lines around $t=8$."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "metadata": {},
   "source": [
    "average_flow_rate(volume,7.9,8.1)"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "metadata": {},
   "source": [
    "average_flow_rate(volume,7.99,8.01)"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "metadata": {},
   "source": [
    "average_flow_rate(volume,7.999,8.001)"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "metadata": {},
   "source": [
    "average_flow_rate(volume,7.9999,8.0001)"
   ],
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Exercise:** For the sign function defined in Python below, convince yourself that it doesn’t have a derivative at $x=0$."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {},
   "source": [
    "def sign(x):\n",
    "    return x / abs(x)"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "metadata": {},
   "source": [
    "average_flow_rate(sign,-0.1,0.1)"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "metadata": {},
   "source": [
    "average_flow_rate(sign,-0.01,0.01)"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {},
   "source": [
    "average_flow_rate(sign,-0.001,0.001)"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {},
   "source": [
    "average_flow_rate(sign,-0.000001,0.000001)"
   ],
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 4 Approximating the change in volume"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 4.1 Finding the change in volume on a short time interval"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "source": [
    "def small_volume_change(q,t,dt):\n",
    "    return q(t) * dt"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {},
   "source": [
    "small_volume_change(flow_rate,2,1)"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {},
   "source": [
    "volume(3) - volume(2)"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "metadata": {},
   "source": [
    "small_volume_change(flow_rate,2,0.01)"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "metadata": {},
   "source": [
    "volume(2.01) - volume(2)"
   ],
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 4.2 Breaking up time into small intervals"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "metadata": {},
   "source": [
    "def volume_change(q,t1,t2,dt):\n",
    "    return sum(small_volume_change(q,t,dt)\n",
    "               for t in np.arange(t1,t2,dt))"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "metadata": {},
   "source": [
    "volume_change(flow_rate,0,10,0.1)"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "metadata": {},
   "source": [
    "volume(10) - volume(0)"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "metadata": {},
   "source": [
    "volume_change(flow_rate,0,10,0.0001)"
   ],
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 4.3 Picturing the volume change on the flow rate graph"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 4.4 Exercises"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Exercise:** Approximately how much oil is added to the tank in the first 6 hours?  In the last 4 hours?  During which time interval is more added?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "metadata": {},
   "source": [
    "volume_change(flow_rate,0,6,0.01)"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "metadata": {},
   "source": [
    "volume_change(flow_rate,6,10,0.01)"
   ],
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 5 Plotting the volume over time"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 5.1 Finding the volume over time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "metadata": {},
   "source": [
    "def approximate_volume(q,v0,dt,T):\n",
    "    return v0 + volume_change(q,0,T,dt)"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "metadata": {},
   "source": [
    "def approximate_volume_function(q,v0,dt):\n",
    "    def volume_function(T):\n",
    "        return approximate_volume(q,v0,dt,T)\n",
    "    return volume_function"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "metadata": {},
   "source": [
    "plot_volume(approximate_volume_function(flow_rate,2.3,0.5),0,10)\n",
    "plot_volume(volume,0,10)"
   ],
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 5.2 Picturing Riemann sums for the volume function"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "metadata": {},
   "source": [
    "np.arange(0,3.9,0.5)"
   ],
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 5.3 Improving the approximation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 94,
   "metadata": {},
   "source": [
    "plot_volume(approximate_volume_function(flow_rate,2.3,0.1),0,10)\n",
    "plot_volume(volume,0,10)"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 95,
   "metadata": {},
   "source": [
    "plot_volume(approximate_volume_function(flow_rate,2.3,0.01),0,10)\n",
    "plot_volume(volume,0,10)"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "metadata": {},
   "source": [
    "def get_volume_function(q,v0,digits=6):\n",
    "    def volume_function(T):\n",
    "        tolerance = 10 ** (-digits)\n",
    "        dt = 1\n",
    "        approx = v0 + volume_change(q,0,T,dt)\n",
    "        for i in range(0,digits*2):\n",
    "            dt = dt / 10\n",
    "            next_approx = v0 + volume_change(q,0,T,dt)\n",
    "            if abs(next_approx - approx) < tolerance:\n",
    "                return round(next_approx,digits)\n",
    "            else:\n",
    "                approx = next_approx\n",
    "        raise Exception(\"Did not converge!\")\n",
    "    return volume_function"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 97,
   "metadata": {},
   "source": [
    "v = get_volume_function(flow_rate,2.3,digits=3)"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 98,
   "metadata": {},
   "source": [
    "v(1)"
   ],
   "outputs": []
  },
  {
   "cell_type": "code",
   "execution_count": 99,
   "metadata": {},
   "source": [
    "v = get_volume_function(flow_rate,2.3,digits=6)"
   ],
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This next line is commented out since it may take 10+ seconds to run, depending on your computer."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 101,
   "metadata": {},
   "source": [
    "# v(1)"
   ],
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 5.4 Definite and indefinite integrals"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 6 Summary"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
